<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>弓友之家</title>
    <link rel="stylesheet" href="css/mui.css" />
    <link rel="stylesheet" href="fonts/iconfont.css" />
    <link rel="stylesheet" href="css/style.css" />
    <style>
    	.set ul li:after{left: 0;}
    </style>
</head>
<body>
	<header class="mui-bar mui-bar-nav">
		<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		<h1 class="mui-title">设置</h1>
	</header>
	<div class="mui-content">
		<div class="set">
			<ul class="mui-table-view">
				<li class="mui-table-view-cell"><a>
					<span>头像</span><img src="images/defaultimg.jpg" id="my_img_id" /><small style="color: #999; font-size: 12px;">点击头像修改</small>
				</a></li>
				<li class="mui-table-view-cell"><a href="address.html" class="mui-navigate-right">
					地址管理
				</a></li>
			</ul>
			<div class="mui-content-padded">
				<button type="button" onclick="loginout()">退出登录</button>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="js/mui.min.js" ></script>
	<script type="text/javascript" src="js/jquery-1.8.3.min.js" ></script>
	<script type="text/javascript" src="js/common.js" ></script>
	<script type="text/javascript" src="js/uploadtx.js" ></script>
	<script type="text/javascript" charset="utf-8">
      	mui.init();
      	mui.plusReady(function() {
		  var all = plus.webview.all(); 
		  var current = plus.webview.currentWebview().id; 
		  for(var i=0,len=all.length;i<len;i++){ 
		    //alert(i);
		      if(all[i].id!==current){ 
		          all[i].close(); 
		      }  
		  } 
		})
      	mui.ajax(H_SRC+'/amier/user/index',{
			data:{
				token:token
			},
			dataType:'json',//服务器返回json格式数据
			type:'post',//HTTP请求类型
			timeout:10000,//超时时间设置为10秒；
			success:function(data){ 
				var dataurl=data.data;
				if(data.code == 401)
				{
					mui.openWindow({
						url:'login.html',
						id:'login.html'
					})
				}else if(data.code == 1)  
				{
					if(dataurl.touxiang==""){
						
					}else{
						$("#my_img_id").attr("src",H_SRC+''+dataurl.touxiang); 
					} 
				}else{ 
					mui.toast(data.msg);
				}
			},
			error:function(xhr,type,errorThrown){
				alert(errorThrown) 
			}
		}) 
      	//退出当前账号
		function loginout(){
			set("token",null);
			mui.openWindow({
				url:'login.html',
				id:'login.html',
				createNew:true
			})
		}
    </script>
</body>
</html>